package org.nidy.erp.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.nidy.erp.pojo.Goods;
import org.nidy.erp.pojo.ItemClass;
import org.nidy.erp.service.IGoodsService;
import org.nidy.erp.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/goods")
@CrossOrigin(origins = "*", maxAge = 3600)
@Slf4j
public class GoodsController {
    @Autowired
    private IGoodsService iGoodsService;
    @GetMapping("/getGoodsList")
    public ResponseResult getGoodsList(){
        List<Goods> goodsList = iGoodsService.list();
        return ResponseResult.success(goodsList);
    }

    @GetMapping("/getBigHomeItemClass")
    public ResponseResult getBigHomeItemClass(){
        List<ItemClass> itemList = iGoodsService.getBigHomeItemClass();
        return ResponseResult.success(itemList);
    }
}
